package com.xhwl.centiotdata.handler.eesd.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xhwl.centiotdata.handler.eesd.EesdFactory;
import com.xhwl.centiotdata.handler.eesd.EesdHandler;
import com.xhwl.centiotdata.pojo.dto.eesd.EesdConfigDTO;
import com.xhwl.centiotdata.pojo.enums.eesd.EesdMethodEnum;
import com.xhwl.centiotdata.suppliersystem.eesd.bes.BesApiHandler;
import com.xhwl.centiotdata.utils.ThreadPoolExecutorService;

/**
 * @Author： lianghz
 * @Description：
 * @Date 2021/09/06/ 11:31
 */
@Service
public class EesdBESHandler extends EesdHandler {

    @Autowired
    private BesApiHandler besApiHandler;

    @Override
    public void afterPropertiesSet() {
        EesdFactory.register(EesdMethodEnum.BES.getId(), this);
    }

    @Override
    public void pullDevice(EesdConfigDTO eesdConfigDTO) {
        //拉取BES设备
        ThreadPoolExecutorService.getThreadPool().submit(() -> {
        	besApiHandler.pullBaDevice(eesdConfigDTO);
        });
    }
}
